package com.lmiot.xyclick.Method;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Rect;
import android.os.Build;
import android.text.TextUtils;
import android.view.accessibility.AccessibilityNodeInfo;

import com.google.gson.Gson;
import com.lmiot.xyclick.ActionDetailBean.DetailBean;
import com.lmiot.xyclick.App.MyApp;
import com.lmiot.xyclick.Bean.DoAutoBean;
import com.lmiot.xyclick.Bean.IfBean;
import com.lmiot.xyclick.Bean.ResloveViewBean;
import com.lmiot.xyclick.Bean.SQL.ActionBean;
import com.lmiot.xyclick.Bean.SQL.ActionBeanSqlUtil;
import com.lmiot.xyclick.Bean.SQL.AutoBean;
import com.lmiot.xyclick.Bean.SQL.AutoBeanSqlUtil;
import com.lmiot.xyclick.Thread.AutoThread;
import com.lmiot.xyclick.Util.CheckUtil;
import com.lmiot.xyclick.Util.ClickUtils;
import com.lmiot.xyclick.Util.Constants;
import com.lmiot.xyclick.Util.DataUtil;
import com.lmiot.xyclick.Util.LayoutDialogUtil;
import com.lmiot.xyclick.Util.LkxLog;
import com.lmiot.xyclick.Util.LogUtil;
import com.lmiot.xyclick.Util.LoopUtils;
import com.xiaoyi.intentsdklibrary.Bean.PointBean;
import com.xiaoyi.intentsdklibrary.Bean.TextBean;
import com.xiaoyi.intentsdklibrary.Bean.TopTipBean;
import com.xiaoyi.intentsdklibrary.Bean.ViewBean;
import com.xiaoyi.intentsdklibrary.SDK.Action.Accessibility;
import com.xiaoyi.intentsdklibrary.SDK.Action.ActionAsSDK;
import com.xiaoyi.intentsdklibrary.SDK.Action.ActionNormalSDK;
import com.xiaoyi.intentsdklibrary.SDK.SDK;
import com.xiaoyi.intentsdklibrary.Utils.MathUtils;
import com.yhao.floatwindow.FloatUtil;
import com.youyi.yyviewsdklibrary.ArrayGson;
import com.youyi.yyviewsdklibrary.Dialog.util.ToastUtil;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.greenrobot.eventbus.EventBus;
import org.opencv.OpenCVSDK;
import org.opencv.SDK.OpenCVUtils;
import org.opencv.core.FastResultBean;

public class DoActionUtils {
    private static final String TAG = "DoActionUtils";
    private static int insignAutoNum;
    private static List<ActionBean> listViewActionBeanList;
    private static Set<String> mLimitString;

    private static void clickMultiPointTimes(AutoThread paramAutoThread, List<PointBean> paramList, int paramInt) {
        int i = 0;
        if (paramInt == -1) {
            try {
                while (SDK.isRunning) {
                    if (paramAutoThread.pause) {
                        paramAutoThread.onPause();
                    }
                    ActionAsSDK.getInstance().clickMultiPoint(paramList);
                    Thread.sleep(100L);
                }
                i = 0;
            } catch (Exception e) {

            }
        }
        while (i < paramInt) {
            if (paramAutoThread.pause) {
                paramAutoThread.onPause();
            }
            if (SDK.isRunning) {
                ActionAsSDK.getInstance().clickMultiPoint(paramList);
                try {
                    Thread.sleep(100L);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                    e.printStackTrace();

                }
                i++;
                continue;
            }
        }
    }

    private static void clickRectRandom(AutoThread paramAutoThread, Rect paramRect, int paramInt1, int paramInt2) {
        int i = 0;
        if (paramInt1 == -1) {
            try {
                while (SDK.isRunning) {
                    if (paramAutoThread.pause) {
                        paramAutoThread.onPause();
                    }
                    i = MathUtils.randomNum(paramRect.left, paramRect.right);
                    paramInt1 = MathUtils.randomNum(paramRect.top, paramRect.bottom);
                    ActionAsSDK.getInstance().clickXY(i, paramInt1);
                    Thread.sleep(paramInt2);
                }
                i = 0;
            } catch (Exception e) {
            }
        }
        while (i < paramInt1) {
            if (paramAutoThread.pause) {
                paramAutoThread.onPause();
            }
            if (SDK.isRunning) {
                int j = MathUtils.randomNum(paramRect.left, paramRect.right);
                int k = MathUtils.randomNum(paramRect.top, paramRect.bottom);
                ActionAsSDK.getInstance().clickXY(j, k);
                try {
                    Thread.sleep(paramInt2);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                i++;
                continue;
            }
        }
    }

    private static void clickTextRectTimes(AutoThread paramAutoThread, String paramString, Rect paramRect, int paramInt) {
        if (paramInt == -1) {
            while (SDK.isRunning) {
                if (paramAutoThread.pause) {
                    paramAutoThread.onPause();
                }
                ActionAsSDK.getInstance().clickTextRect(paramString, paramRect);
            }
        }
        for (int i = 0; i < paramInt; i++) {
            if (paramAutoThread.pause) {
                paramAutoThread.onPause();
            }
            if (!SDK.isRunning) {
                break;
            }
            ActionAsSDK.getInstance().clickTextRect(paramString, paramRect);
        }
    }

    private static void clickXYTimes(AutoThread paramAutoThread, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
        if (paramInt3 == -1) {
            try {
                while (SDK.isRunning) {
                    if (paramAutoThread.pause) {
                        paramAutoThread.onPause();
                    }
                    ActionAsSDK.getInstance().clickXY(paramInt1, paramInt2);
                    Thread.sleep(paramInt4);
                }
            } catch (InterruptedException e) {
            }
        }
        int i = 0;

        while (i < paramInt3) {
            if (paramAutoThread.pause) {
                paramAutoThread.onPause();
            }
            if (SDK.isRunning) {
                ActionAsSDK.getInstance().clickXY(paramInt1, paramInt2);
                try {
                    Thread.sleep(paramInt4);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                i++;
                continue;
            }
        }
    }

    public static void doAction(AutoThread paramAutoThread, ActionBean paramActionBean) {
        try {
            String actionType = paramActionBean.getActionType();
            LkxLog.d("DoActionUtils 执行动作 actionType ："+ actionType);
            String localObject1 = DataUtil.getDenyList(MyApp.getContext());
            String localObject2 = ActionAsSDK.getInstance().findPackName();
            if ((!TextUtils.isEmpty((CharSequence) localObject2)) && (((String) localObject1).contains((CharSequence) localObject2))) {
                ToastUtil.err("当前APP受保护哦，暂时无法使用本软件，抱歉！");
                EventBus eventBus = EventBus.getDefault();
                DoAutoBean doAutoBean = new DoAutoBean(104, null, null, 0);
                eventBus.post(doAutoBean);
                return;
            }

            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append("动作详情:");
            Gson gson = new Gson();
            stringBuilder.append(gson.toJson(paramActionBean));
            LkxLog.d("DoActionUtils 执行动作："+ stringBuilder.toString());
            if (paramActionBean == null) {
                return;
            }
            if (paramActionBean.getEnable()) {
                localObject1 = paramActionBean.getDetail();
                String localObject4 = paramActionBean.getActionType();
                ArrayGson arrayGson = new ArrayGson();
                DetailBean detailBean = arrayGson.fromJson((String) localObject1, DetailBean.class);
                List<PointBean> mPointBeanList = null;
                if (detailBean != null) {
                    mPointBeanList = detailBean.getPointBeanList();
                }
                EventBus localEventBus = EventBus.getDefault();
                TopTipBean topTipBean = new TopTipBean(paramActionBean.getActionName());
                localEventBus.post(topTipBean);
                boolean bool;
                int j;
                int i;
                label7618:
                label7637:
                label7640:
                label7799:
                label11509:
                switch (actionType) {
                    case "key_empty_action":
                    default:
                        break;
                    case "view_list":
                        listViewActionBeanList = detailBean.getActionBeanList();
                        mLimitString = new HashSet<>();
                        recyListView((detailBean).getRepeat(), paramAutoThread, detailBean.getViewBean(), detailBean.getListLimitViewBean());
                        break;
                    case "view_find_activity":
                        if (ActionAsSDK.getInstance().findActivityName().equals((detailBean).getActivityName())) {
                            tip("目标页面一致");
                            doAction(paramAutoThread, (detailBean.getIFActionBean()));
                        } else {
                            tip("目标页面不一致");
                            doAction(paramAutoThread, (detailBean.getElseActionBean()));
                        }
                        break;
                    case "view_find_packname":
                        if (((String) localObject2).equals(detailBean.getPackName())) {
                            tip("目标包名");
                            doAction(paramAutoThread, detailBean.getIFActionBean());
                        } else {
                            tip("目标包名不一致");
                            doAction(paramAutoThread, detailBean.getElseActionBean());
                        }
                        break;
                    case "view_find_id_check":
                        if (ActionAsSDK.getInstance().findViewState(detailBean.getViewBean())) {
                            tip("发现目标控件");
                            doAction(paramAutoThread, detailBean.getIFActionBean());
                        } else {
                            tip("没有发现目标控件");
                            doAction(paramAutoThread, detailBean.getElseActionBean());
                        }
                        break;
                    case "view_find_id_des":
                        if (ActionAsSDK.getInstance().findViewDes(detailBean.getViewBean())) {
                            tip("发现目标控件");
                            doAction(paramAutoThread, detailBean.getIFActionBean());
                        } else {
                            tip("没有发现目标控件");
                            doAction(paramAutoThread, detailBean.getElseActionBean());
                        }
                        break;
                    case "view_find_id_text":
                        if (ActionAsSDK.getInstance().findViewText(detailBean.getViewBean())) {
                            tip("发现目标控件");
                            doAction(paramAutoThread, detailBean.getIFActionBean());
                        } else {
                            tip("没有发现目标控件");
                            doAction(paramAutoThread, detailBean.getElseActionBean());
                        }
                        break;
                    case "view_find_id":
                        if (ActionAsSDK.getInstance().findHasViewID(detailBean.getViewBean())) {
                            tip("发现目标控件ID");
                            doAction(paramAutoThread, detailBean.getIFActionBean());
                        } else {
                            tip("没有发现目标控件ID");
                            doAction(paramAutoThread, detailBean.getElseActionBean());
                        }
                        break;
                    case "view_find_id_text_wait":
                        j = detailBean.getDruation();
                        for (i = 0; i < j; i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            if (ActionAsSDK.getInstance().findViewText(detailBean.getViewBean())) {
                                tip("发现目标控件");
                                doAction(paramAutoThread, detailBean.getIFActionBean());
                                break;
                            }
                            Thread.sleep(1000L);
                            if (i == j - 1) {
                                tip("等待超时");
                                doAction(paramAutoThread, detailBean.getElseActionBean());
                            }
                        }
                    case "view_find_id_wait":
                        j = detailBean.getDruation();
                        for (i = 0; i < j; i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            if (ActionAsSDK.getInstance().findHasViewID(detailBean.getViewBean())) {
                                tip("发现目标控件ID");
                                doAction(paramAutoThread, detailBean.getIFActionBean());
                                break;
                            }
                            Thread.sleep(1000L);
                            if (i == j - 1) {
                                tip("等待超时");
                                doAction(paramAutoThread, detailBean.getElseActionBean());
                            }
                        }
                    case "if_action_wait_img":
                        j = detailBean.getDruation();
                        for (i = 0; i < j; i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            String imagePath = detailBean.getImgPath();
                            FastResultBean fastResultBean = OpenCVUtils.findOneTarget(LoopUtils.cutFull(), BitmapFactory.decodeFile(imagePath));
                            if ((fastResultBean != null) && (fastResultBean.getLikeNum() >= OpenCVSDK.getInstance().getPicLike(MyApp.getContext()))) {
                                tip("发现目标图片");
                                doAction(paramAutoThread, detailBean.getIFActionBean());
                                break;
                            }
                            Thread.sleep(1000L);
                            if (i == j - 1) {
                                tip("等待超时");
                                doAction(paramAutoThread, detailBean.getElseActionBean());
                            }
                        }
                    case "if_action_wait_text":
                        j = detailBean.getDruation();
                        for (i = 0; i < j; i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            if (ActionAsSDK.getInstance().findAllText01().contains(detailBean.getText())) {
                                tip("发现目标文字");
                                doAction(paramAutoThread, detailBean.getIFActionBean());
                                break;
                            }
                            Thread.sleep(1000L);
                            if (i == j - 1) {
                                tip("等待超时");
                                doAction(paramAutoThread, detailBean.getElseActionBean());
                            }
                        }
                    case "view_clickid_normal":
                    case "view_long_click_normal":
                    case "view_input":
                    case "view_checked":
                    case "view_uncheck":
                        ActionAsSDK.getInstance().controlView(detailBean.getViewBean());
                        break;
                    case "view_w_activity":
                        j = detailBean.getDruation();
                        for (i = 0; i < j; i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            if (ActionAsSDK.getInstance().findActivityName().equals(detailBean.getActivityName())) {
                                tip("发现目标控件");
                                doAction(paramAutoThread, detailBean.getIFActionBean());
                                break;
                            }
                            tip("等待目标页面");
                            Thread.sleep(1000L);
                            if (i == j - 1) {
                                tip("等待超时");
                                doAction(paramAutoThread, detailBean.getElseActionBean());
                            }
                        }
                    case "view_w_a_id":
                        j = detailBean.getDruation();
                        for (i = 0; i < j; i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            if (ActionAsSDK.getInstance().findHasViewIDByString(detailBean.getText())) {
                                tip("发现目标控件ID");
                                ActionAsSDK.getInstance().clickViewID(detailBean.getText());
                                break;
                            }
                            tip("等待目标控件ID");
                            Thread.sleep(1000L);
                            if (i == j - 1) {
                                tip("等待超时");
                            }
                        }
                    case "view_find_id_wait_hand":
                        j = detailBean.getDruation();
                        for (i = 0; i < j; i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            if (ActionAsSDK.getInstance().findHasViewIDByString(detailBean.getText())) {
                                tip("发现目标控件ID");
                                doAction(paramAutoThread, detailBean.getIFActionBean());
                                break;
                            }
                            Thread.sleep(1000L);
                            if (i == j - 1) {
                                tip("等待超时");
                                doAction(paramAutoThread, detailBean.getElseActionBean());
                            }
                        }
                    case "view_find_id_hand":
                        if (ActionAsSDK.getInstance().findHasViewIDByString(detailBean.getText())) {
                            tip("发现目标控件ID");
                            doAction(paramAutoThread, detailBean.getIFActionBean());
                        } else {
                            tip("没有发现目标控件ID");
                            doAction(paramAutoThread, detailBean.getElseActionBean());
                        }
                        break;
                    case "view_clickid_normal_all":
                    case "view_clickid_normal_hand_all":
                        List<PointBean> pointBeanList = ActionAsSDK.getInstance().findViewByIDAll(detailBean.getText());
                        if (paramActionBean != null) {
                            tip("遍历点击控件");
                            Iterator<PointBean> iterator = pointBeanList.iterator();
                            while ((iterator.hasNext())){
                                PointBean  pointBean = (PointBean) (iterator.next());
                                if (paramAutoThread.pause) {
                                    paramAutoThread.onPause();
                                }
                                if (!SDK.isRunning) {
                                    break;
                                }
                                ActionAsSDK.getInstance().clickXY(pointBean.getX(), pointBean.getY());
                                Thread.sleep(500L);
                            }
                        }
                        tip("控件为空");
                        break;
                    case "view_clickid_normal_n":
                        tip("点击控件");
                        ActionAsSDK.getInstance().clickViewIDByPosition(detailBean.getText(), detailBean.getValue());
                        break;
                    case "view_clickid_normal_hand":
                        tip("点击控件");
                        ActionAsSDK.getInstance().clickViewID(detailBean.getText());
                        break;
                    case "view_all":
                        EventBus eventBus = EventBus.getDefault();
                        ResloveViewBean  resloveViewBean = new ResloveViewBean(true);
                        eventBus.post(resloveViewBean);
                        break;
                    case "if_action_logic":
                            tip("不满足多条件");
                        break;
                    case "if_action_plus_goto":
                        paramActionBean = detailBean.getGotoAction();
                        List<ActionBean> autoBean = ActionBeanSqlUtil.getInstance().searchByID(paramActionBean.getAutoID());
                        AutoBean autoBean1 = AutoBeanSqlUtil.getInstance().searchByID(paramActionBean.getAutoID());
                        if ((autoBean != null) && (((List) autoBean).size() > 0)) {
                            for (i = 0; i < ((List) autoBean).size(); i++) {
                                if (paramAutoThread.pause) {
                                    paramAutoThread.onPause();
                                }
                                if (!SDK.isRunning) {
                                    break;
                                }
                                if (((ActionBean) ((List) autoBean).get(i)).getActionID().equals(paramActionBean.getActionID())) {
                                    break label7799;
                                }
                            }
                        }
                        break;//逻辑可能有问题，只诶brrak
//                        int i = -1;
//                        if (i == -1) {
//                            break;
//                        }
//                        jumgGoto(paramAutoThread, autoBean1, i);
//                        break;
                    case "if_action_goto":
                        jumgGoto(paramAutoThread, AutoBeanSqlUtil.getInstance().searchByID(paramActionBean.getAutoID()), detailBean.getGotoNum());
                        break;
                    case "if_action_wait":
                        for (; ; ) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            if (LoopUtils.judgeAciton(detailBean.getIfBean())) {
                                doAction(paramAutoThread, detailBean.getDoActonBean());
                                break;
                            }
                            if (ActionAsSDK.getWaitTime(MyApp.getContext())) {
                                Thread.sleep(1000L);
                            }
                        }
                    case "if_action_while":
                        for (; ; ) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            if (LoopUtils.judgeAciton(detailBean.getIfBean())) {
                                doAction(paramAutoThread, detailBean.getDoActonBean());
                            }
                            if (ActionAsSDK.getWaitTime(MyApp.getContext())) {
                                Thread.sleep(1000L);
                            }
                        }
                    case "if_action_for_break":
                        for (i = 0; i < detailBean.getRepeat(); i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            bool = LoopUtils.judgeAciton(detailBean.getBreakIfBean());
                            LogUtil.d("DoActionUtils", "isBreakSuccess:"+bool);
                            if (bool) {
                                break;
                            }
                            doAction(paramAutoThread, detailBean.getDoActonBean());
                            if (ActionAsSDK.getWaitTime(MyApp.getContext())) {
                                Thread.sleep(1000L);
                            }
                        }
                    case "if_action_for_plus":
                        tip("执行for循环语句加强版");
                        List<ActionBean> actionBeans = detailBean.getActionBeanList();
                        for (i = 0; i < detailBean.getRepeat(); i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            Iterator<ActionBean> itear = actionBeans.iterator();
                            while (itear.hasNext()) {
                                paramActionBean = (ActionBean) ((Iterator) itear).next();
                                if (paramAutoThread.pause) {
                                    paramAutoThread.onPause();
                                }
                                if (!SDK.isRunning) {
                                    break;
                                }
                                doAction(paramAutoThread, paramActionBean);
                                if (ActionAsSDK.getWaitTime(MyApp.getContext())) {
                                    Thread.sleep(1000L);
                                }
                            }
                            if (ActionAsSDK.getWaitTime(MyApp.getContext())) {
                                Thread.sleep(1000L);
                            }
                        }
                    case "do_action_list":
                        tip("执行n个动作");
                        Iterator<ActionBean> iterator = detailBean.getActionBeanList().iterator();
                        while (iterator.hasNext()) {
                            ActionBean localObj = iterator.next();
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            doAction(paramAutoThread, localObj);
                            if (ActionAsSDK.getWaitTime(MyApp.getContext())) {
                                Thread.sleep(1000L);
                            }
                        }
                    case "if_action_for":
                        tip("执行for循环语句");
                        for (i = 0; i < detailBean.getRepeat(); i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            doAction(paramAutoThread, detailBean.getDoActonBean());
                            if (ActionAsSDK.getWaitTime(MyApp.getContext())) {
                                Thread.sleep(1000L);
                            }
                        }
                    case "if_action_str_end":
                        IfBean ifBean = new IfBean();
                        ifBean.setType(paramActionBean.getActionType());
                         ifBean.setText(detailBean.getText());
                         ifBean.setRect(detailBean.getRect());
                        ifBean.setIfName("包含：结尾字符串"+detailBean.getText());
                        CheckIfAction checkIfAction = CheckIfAction.getInstance();
                        ((CheckIfAction) checkIfAction).check((IfBean) ifBean, new CheckIfAction.OnResultListener() {
                            @Override
                            public void result(boolean z) {
                                tip("检测通过");
                            }
                        });
                        break;
                    case "if_action_str_start":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setText(detailBean.getText());
//                        ((IfBean) localObject1).setRect(detailBean.getRect());
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("包含：开头字符串");
//                        paramActionBean.append(detailBean.getText());
//                        ((IfBean) localObject1).setIfName(paramActionBean.toString());
//                        localObject4 = CheckIfAction.getInstance();
//                        paramActionBean = new com / lmiot / xyclick / Method / DoActionUtils$20;
//                        paramActionBean.<init> (paramAutoThread, (DetailBean) localObject3);
//                        ((CheckIfAction) localObject4).check((IfBean) localObject1, paramActionBean);
                        break;
                    case "if_action_str_contain":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setText(detailBean.getText());
//                        ((IfBean) localObject1).setRect(detailBean.getRect());
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("包含：字符串");
//                        paramActionBean.append(detailBean.getText());
//                        ((IfBean) localObject1).setIfName(paramActionBean.toString());
//                        localObject4 = CheckIfAction.getInstance();
//                        paramActionBean = new com / lmiot / xyclick / Method / DoActionUtils$19;
//                        paramActionBean.<init> (paramAutoThread, (DetailBean) localObject3);
//                        ((CheckIfAction) localObject4).check((IfBean) localObject1, paramActionBean);
                        break;
                    case "if_action_str_length":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setMinNum(detailBean.getMinNum());
//                        ((IfBean) localObject1).setMaxNum(detailBean.getMaxNum());
//                        ((IfBean) localObject1).setRect(detailBean.getRect());
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("长度:");
//                        paramActionBean.append(detailBean.getMinNum());
//                        paramActionBean.append("～");
//                        paramActionBean.append(detailBean.getMaxNum());
//                        ((IfBean) localObject1).setIfName(paramActionBean.toString());
//                        paramActionBean = CheckIfAction.getInstance();
//                        localObject4 = new com / lmiot / xyclick / Method / DoActionUtils$18;
//                        ((18) localObject4).<init > (paramAutoThread, (DetailBean) localObject3);
//                        paramActionBean.check((IfBean) localObject1, (CheckIfAction.OnResultListener) localObject4);
                        break;
                    case "if_action_color_rect":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setRect(detailBean.getRect());
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setIfBeanColor(detailBean.getIfBeanColor());
//                        ((IfBean) localObject1).setRect(detailBean.getIfBeanColor().getRect());
//                        ((IfBean) localObject1).setIfBeanColor(detailBean.getIfBeanColor());
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("颜色：");
//                        paramActionBean.append(detailBean.getIfBeanColor().getName());
//                        ((IfBean) localObject1).setIfName(paramActionBean.toString());
//                        paramActionBean = CheckIfAction.getInstance();
//                        localObject4 = new com / lmiot / xyclick / Method / DoActionUtils$17;
//                        ((17) localObject4).<init > (paramAutoThread, (DetailBean) localObject3);
//                        paramActionBean.check((IfBean) localObject1, (CheckIfAction.OnResultListener) localObject4);
                        break;
                    case "if_action_color_more":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setIfBeanColor(detailBean.getIfBeanColor());
//                        ((IfBean) localObject1).setRect(detailBean.getIfBeanColor().getRect());
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("颜色：");
//                        paramActionBean.append(detailBean.getIfBeanColor().getName());
//                        ((IfBean) localObject1).setIfName(paramActionBean.toString());
//                        ((IfBean) localObject1).setIfBeanColor(detailBean.getIfBeanColor());
//                        localObject4 = CheckIfAction.getInstance();
//                        paramActionBean = new com / lmiot / xyclick / Method / DoActionUtils$16;
//                        paramActionBean.<init> (paramAutoThread, (DetailBean) localObject3);
//                        ((CheckIfAction) localObject4).check((IfBean) localObject1, paramActionBean);
                        break;
                    case "if_action_color_screen":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setIfBeanColor(detailBean.getIfBeanColor());
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("颜色：");
//                        paramActionBean.append(detailBean.getIfBeanColor().getName());
//                        ((IfBean) localObject1).setIfName(paramActionBean.toString());
//                        localObject4 = CheckIfAction.getInstance();
//                        paramActionBean = new com / lmiot / xyclick / Method / DoActionUtils$15;
//                        paramActionBean.<init> (paramAutoThread, (DetailBean) localObject3);
//                        ((CheckIfAction) localObject4).check((IfBean) localObject1, paramActionBean);
                        break;
                    case "if_action_color":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setIfBeanColor(detailBean.getIfBeanColor());
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("颜色：");
//                        paramActionBean.append(detailBean.getIfBeanColor().getName());
//                        ((IfBean) localObject1).setIfName(paramActionBean.toString());
//                        localObject4 = CheckIfAction.getInstance();
//                        paramActionBean = new com / lmiot / xyclick / Method / DoActionUtils$14;
//                        paramActionBean.<init> (paramAutoThread, (DetailBean) localObject3);
//                        ((CheckIfAction) localObject4).check((IfBean) localObject1, paramActionBean);
                        break;
                    case "if_action_time":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setStartTime(detailBean.getStartTime());
//                        ((IfBean) localObject1).setEndTime(detailBean.getEndTime());
//                        localObject2 = detailBean.getStartTime();
//                        paramActionBean = detailBean.getEndTime();
//                        localObject4 = new java / lang / StringBuilder;
//                        ((StringBuilder) localObject4).<init> ();
//                        ((StringBuilder) localObject4).append("时间条件：");
//                        ((StringBuilder) localObject4).append((String) localObject2);
//                        ((StringBuilder) localObject4).append("～");
//                        ((StringBuilder) localObject4).append(paramActionBean);
//                        ((IfBean) localObject1).setIfName(((StringBuilder) localObject4).toString());
//                        localObject4 = CheckIfAction.getInstance();
//                        paramActionBean = new com / lmiot / xyclick / Method / DoActionUtils$13;
//                        paramActionBean.<init> (paramAutoThread, (DetailBean) localObject3);
//                        ((CheckIfAction) localObject4).check((IfBean) localObject1, paramActionBean);
                        break;
                    case "if_action_big":
                    case "if_big_normal":
                    case "if_big_dot":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setRect(detailBean.getRect());
//                        ((IfBean) localObject1).setSign(detailBean.getSign());
//                        ((IfBean) localObject1).setValue(detailBean.getValue());
//                        paramActionBean = "";
//                        localObject4 = detailBean.getSign();
//                        switch (((String) localObject4).hashCode()) {
//                            default:
//                                break;
//                            case 1095229278:
//                                if (((String) localObject4).equals("SIGN_BIG")) {
//                                    i = 0;
//                                }
//                                break;
//                            case 514467563:
//                                if (((String) localObject4).equals("SIGN_BIG_AND_EQUAL")) {
//                                    i = 3;
//                                }
//                                break;
//                            case 263818365:
//                                if (((String) localObject4).equals("SIGN_SAMLL")) {
//                                    i = 1;
//                                }
//                                break;
//                            case 251373074:
//                                if (((String) localObject4).equals("SIGN_EQUAL")) {
//                                    i = 2;
//                                }
//                                break;
//                            case -191459948:
//                                if (((String) localObject4).equals("SIGN_SMAL_AND_EQUAL")) {
//                                    i = 4;
//                                }
//                                break;
//                            case -1570081146:
//                                if (((String) localObject4).equals("SIGN_NOT_EQUAL")) {
//                                    i = 5;
//                                }
//                                break;
//                        }
//                        i = -1;
//                        if (i != 0) {
//                            if (i != 1) {
//                                if (i != 2) {
//                                    if (i != 3) {
//                                        if (i != 4) {
//                                            if (i == 5) {
//                                                paramActionBean = "!=";
//                                            }
//                                        } else {
//                                            paramActionBean = "<=";
//                                        }
//                                    } else {
//                                        paramActionBean = ">=";
//                                    }
//                                } else {
//                                    paramActionBean = "=";
//                                }
//                            } else {
//                                paramActionBean = "<";
//                            }
//                        } else {
//                            paramActionBean = ">";
//                        }
//                        localObject4 = new java / lang / StringBuilder;
//                        ((StringBuilder) localObject4).<init> ();
//                        ((StringBuilder) localObject4).append("条件：目标数字");
//                        ((StringBuilder) localObject4).append(paramActionBean);
//                        ((StringBuilder) localObject4).append(detailBean.getValue());
//                        ((IfBean) localObject1).setIfName(((StringBuilder) localObject4).toString());
//                        localObject4 = CheckIfAction.getInstance();
//                        paramActionBean = new com / lmiot / xyclick / Method / DoActionUtils$12;
//                        paramActionBean.<init> (paramAutoThread, (DetailBean) localObject3);
//                        ((CheckIfAction) localObject4).check((IfBean) localObject1, paramActionBean);
                        break;
                    case "if_action_pic_rect":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setRect(detailBean.getRect());
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setImgPath(detailBean.getImgPath());
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("检测区域图片(");
//                        paramActionBean.append(detailBean.getImgPath());
//                        paramActionBean.append(")");
//                        ((IfBean) localObject1).setIfName(paramActionBean.toString());
//                        paramActionBean = CheckIfAction.getInstance();
//                        localObject4 = new com / lmiot / xyclick / Method / DoActionUtils$11;
//                        ((11) localObject4).<init > (paramAutoThread, (DetailBean) localObject3);
//                        paramActionBean.check((IfBean) localObject1, (CheckIfAction.OnResultListener) localObject4);
                        break;
                    case "if_action_pic":
                        IfBean ifBea = new IfBean();
                        ifBea.setType(paramActionBean.getActionType());
                        ifBea.setImgPath(detailBean.getImgPath());
                        ifBea.setIfName("检测图片："+detailBean.getImgPath());
                        CheckIfAction checkIfAction1 = CheckIfAction.getInstance();
                        checkIfAction1.check(ifBea, new CheckIfAction.OnResultListener() {
                            @Override
                            public void result(boolean p0) {
                                if (p0) {
                                    DoActionUtils.tip("��������ͼƬ");
                                    DoActionUtils.doAction(paramAutoThread, detailBean.getIFActionBean());
                                }else {
                                    DoActionUtils.tip("δ����ͼƬ");
                                    DoActionUtils.doAction(paramAutoThread, detailBean.getElseActionBean());
                                }
                                return;
                            }
                        });
                        break;
                    case "if_action_text_rect":
                    case "if_action_text_rect_ocr":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setText(detailBean.getText());
//                        ((IfBean) localObject1).setRect(detailBean.getRect());
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("检测区域文字(");
//                        paramActionBean.append(((IfBean) localObject1).getText());
//                        paramActionBean.append(")");
//                        ((IfBean) localObject1).setIfName(paramActionBean.toString());
//                        localObject4 = CheckIfAction.getInstance();
//                        paramActionBean = new com / lmiot / xyclick / Method / DoActionUtils$9;
//                        paramActionBean.<init> (paramAutoThread, (DetailBean) localObject3);
//                        ((CheckIfAction) localObject4).check((IfBean) localObject1, paramActionBean);
                        break;
                    case "if_action_text":
                    case "if_action_text_ocr":
//                        localObject1 = new com / lmiot / xyclick / Bean / IfBean;
//                        ((IfBean) localObject1).<init> ();
//                        ((IfBean) localObject1).setType(paramActionBean.getActionType());
//                        ((IfBean) localObject1).setText(detailBean.getText());
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("检测全屏文字：");
//                        paramActionBean.append(((IfBean) localObject1).getText());
//                        ((IfBean) localObject1).setIfName(paramActionBean.toString());
//                        localObject4 = CheckIfAction.getInstance();
//                        paramActionBean = new com / lmiot / xyclick / Method / DoActionUtils$8;
//                        paramActionBean.<init> (paramAutoThread, (DetailBean) localObject3);
//                        ((CheckIfAction) localObject4).check((IfBean) localObject1, paramActionBean);
                        break;
                    case "key_auto":
//                        paramActionBean = AutoBeanSqlUtil.getInstance().searchByID(detailBean.getAutoID());
//                        localObject1 = new java / lang / StringBuilder;
//                        ((StringBuilder) localObject1).<init> ();
//                        ((StringBuilder) localObject1).append("二级自动化：");
//                        ((StringBuilder) localObject1).append(paramActionBean.getAutoName());
//                        LogUtil.d("DoActionUtils", ((StringBuilder) localObject1).toString());
//                        insignAutoNum = 0;
//                        if (paramActionBean == null) {
//                            break;
//                        }
//                        j = paramActionBean.getRepeatNum();
//                        if (j > 0) {
//                            for (i = 0; i < j; i++) {
//                                if (paramAutoThread.pause) {
//                                    paramAutoThread.onPause();
//                                }
//                                if (!SDK.isRunning) {
//                                    break;
//                                }
//                                executeAuto(paramAutoThread, paramActionBean, -1);
//                                insignAutoNum += 1;
//                            }
//                        }
//                        if (j == 0) {
//                            executeAuto(paramAutoThread, paramActionBean, -1);
//                            break;
//                        }
//                        if (j != -1) {
//                            break;
//                        }
//                        while (SDK.isRunning) {
//                            if (paramAutoThread.pause) {
//                                paramAutoThread.onPause();
//                            }
//                            executeAuto(paramAutoThread, paramActionBean, -1);
//                            insignAutoNum += 1;
//                        }
                    case "key_app":
                        ActionNormalSDK.getInstance().openAPp(MyApp.getContext(), detailBean.getPackName(), detailBean.isAppNew());
                        break;
                    case "key_phone_alarm":
//                        try {
//                            ActionNormalSDK.getInstance().alarmVioce(MyApp.getContext());
//                            while (SDK.isRunning) {
//                                if (paramAutoThread.pause) {
//                                    paramAutoThread.onPause();
//                                }
//                                ActionNormalSDK.getInstance().openLight(MyApp.getContext());
//                                Thread.sleep(1000L);
//                                ActionNormalSDK.getInstance().closeLight(MyApp.getContext());
//                            }
//                            ActionNormalSDK.getInstance().stopAlarmVioce();
//                        } catch (Exception paramAutoThread) {
//                            paramAutoThread.printStackTrace();
//                        }
                    case "key_phone_light_shake":
                        try {
                            while (SDK.isRunning) {
                                if (paramAutoThread.pause) {
                                    paramAutoThread.onPause();
                                }
                                ActionNormalSDK.getInstance().openLight(MyApp.getContext());
                                Thread.sleep(1000L);
                                ActionNormalSDK.getInstance().closeLight(MyApp.getContext());
                            }
                            ClickUtils.onlyVibrate(MyApp.getContext(), detailBean.getValue());
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    case "key_phone_vibrate":
                        break;
                    case "key_phone_speak":
                        ActionNormalSDK.getInstance().speakText(MyApp.getContext(), detailBean.getText());
                        break;
                    case "key_phone_ring":
                        ClickUtils.onlyVice(MyApp.getContext());
                        break;
                    case "key_random_delay_time":
//                        i = detailBean.getMaxNum();
//                        j = detailBean.getMinNum();
//                        paramAutoThread = new java / util / Random;
//                        paramAutoThread.<init> ();
//                        if ((i == 0) && (j == 0)) {
//                            Thread.sleep(0L);
//                        } else {
//                            bool = ActionAsSDK.getDelayUnitMs(MyApp.getContext());
//                            i = paramAutoThread.nextInt(i) % (i - j + 1) + j;
//                            if (bool) {
//                                Thread.sleep(i);
//                            } else {
//                                Thread.sleep(i * 1000);
//                            }
//                        }
                        break;
                    case "key_now_auto_list":
                        LayoutDialogUtil.showAutoList(MyApp.getContext());
                        break;
                    case "key_resume_now_auto":
                        EventBus.getDefault().post(new DoAutoBean(103, null, null, 0));
                        break;
                    case "key_pause_now_auto":
                        EventBus.getDefault().post(new DoAutoBean(102, null, null, 0));
                        break;
                    case "key_stop_now_auto":
                        EventBus.getDefault().post(new DoAutoBean(104, null, null, 0));
                        break;
                    case "tool_send_msg"://发送消息
//                        paramAutoThread = new com / lmiot / xyclick / Method / DoActionUtils$7;
//                        paramAutoThread.<init> detailBean;
//                        YYPerUtils.sms(paramAutoThread);
                        break;
                    case "tool_call"://打电话
//                        paramAutoThread = new com / lmiot / xyclick / Method / DoActionUtils$6;
//                        paramAutoThread.<init> detailBean;
//                        YYPerUtils.call(paramAutoThread);
                        break;
                    case "tool_rect_text"://区域文字
                        try {
//                            paramActionBean = LoopUtils.OCRTextByTargetText(LoopUtils.cutRect(detailBean.getRect()), null);
//                            paramAutoThread = new java / lang / StringBuffer;
//                            paramAutoThread.<init> ();
//                            paramActionBean = paramActionBean.iterator();
//                            while (paramActionBean.hasNext()) {
//                                paramAutoThread.append(((OCRResultBean) paramActionBean.next()).getWord());
//                                paramAutoThread.append("\n");
//                            }
//                            LogUtil.d("DoActionUtils文字：", paramAutoThread.toString());
//                            ((ClipboardManager) MyApp.getContext().getSystemService("clipboard")).setText(paramAutoThread.toString().trim());
//                            tip("已复制区域文字到剪切板！");
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    case "tool_full_text"://全屏文字
                        try {
//                            paramActionBean = LoopUtils.OCRTextByTargetText(LoopUtils.cutFull(), null);
//                            paramAutoThread = new java / lang / StringBuffer;
//                            paramAutoThread.<init> ();
//                            paramActionBean = paramActionBean.iterator();
//                            while (paramActionBean.hasNext()) {
//                                paramAutoThread.append(((OCRResultBean) paramActionBean.next()).getWord());
//                                paramAutoThread.append("\n");
//                            }
//                            ((ClipboardManager) MyApp.getContext().getSystemService("clipboard")).setText(paramAutoThread.toString().trim());
//                            tip("已复制全屏文字到剪切板！");
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    case "tool_shortcut"://系统截图
//                        FloatManager.hide(InitFloatBean.FloatType.pause);
//                        paramAutoThread = ImgUtil.saveBitmpToCash(LoopUtils.cutFull(), TimeUtils.createID());
//                        FloatManager.show(InitFloatBean.FloatType.pause);
//                        ImgUtil.noticSystem(paramAutoThread);
//                        ToastUtil.success("已更新到系统相册!");
//                        if (!FloatUtil.getAutoShare(MyApp.getContext())) {
//                            break;
//                        }
//                        ImgUtil.shareImg(paramAutoThread);
                        break;
                    case "sys_shortcut":
//                        FloatManager.hide(InitFloatBean.FloatType.pause);
//                        Thread.sleep(1000L);
//                        ActionAsSDK.getInstance().performAction(Accessibility.ActionType.ActionShortCut);
//                        Thread.sleep(2000L);
//                        FloatManager.show(InitFloatBean.FloatType.pause);
                        break;
                    case "sys_lock":
                        ActionAsSDK.getInstance().performAction(Accessibility.ActionType.GLOBAL_ACTION_LOCK_SCREEN);
                        break;
                    case "tool_url_scheme"://打开appp
                        if (ActionNormalSDK.getInstance().openUrlScheme(MyApp.getContext(), detailBean.getText())) {
                            break;
                        }
                        tip("不支持此快捷方式，请检查是否安装目标应用！");
                        break;
                    case "tool_open_web":
                        ActionNormalSDK.getInstance().openWeb(MyApp.getContext(), detailBean.getText());
                        break;
                    case "tool_send_email":
                        ActionNormalSDK.getInstance().sendEmail(MyApp.getContext(), detailBean.getText(), detailBean.getTitle(), detailBean.getMsg());
                        break;
                    case "tool_qq_talk":
                        ActionNormalSDK.getInstance().talkQQ(MyApp.getContext(), detailBean.getText());
                        break;
                    case "tool_zxing":
                        ActionNormalSDK.getInstance().toolWxZxing(MyApp.getContext());
                        break;
                    case "tool_zfb_fu":
                        ActionNormalSDK.getInstance().toolZfbCode(MyApp.getContext());
                        break;
                    case "tool_zfb_shou":
                        ActionNormalSDK.getInstance().openZfbShou(MyApp.getContext());
                        break;
                    case "tool_zfb_sao":
                        ActionNormalSDK.getInstance().openZfbZxing(MyApp.getContext());
                        break;
                    case "tool_wx_xiao":
//                        try {
//                            paramAutoThread = new com / tencent / mm / opensdk / modelbiz / WXLaunchMiniProgram$Req;
//                            paramAutoThread.<init> ();
//                            paramAutoThread.userName = detailBean.getText();
//                            paramAutoThread.miniprogramType = 0;
//                            MyApp.getInstance().getApi().sendReq(paramAutoThread);
//                        } catch (Exception paramAutoThread) {
//                            paramAutoThread.printStackTrace();
//                            ToastUtil.err("请安装微信！");
//                        }
                    case "tool_wx_sao":
                        ActionNormalSDK.getInstance().toolWxZxing(MyApp.getContext());
                        break;
                    case "tool_wx_fu":
                        ActionNormalSDK.getInstance().toolWxFu(MyApp.getContext());
                        break;
                    case "tool_volume_down":
//                        paramActionBean = EventBus.getDefault();
//                        paramAutoThread = new com / lmiot / xyclick / Bean / MediaTypeBean;
//                        paramAutoThread.<init> (MediaTypeBean.MediaType.volume_down);
//                        paramActionBean.post(paramAutoThread);
                        break;
                    case "tool_volume_up":
//                        paramActionBean = EventBus.getDefault();
//                        paramAutoThread = new com / lmiot / xyclick / Bean / MediaTypeBean;
//                        paramAutoThread.<init> (MediaTypeBean.MediaType.volume_up);
//                        paramActionBean.post(paramAutoThread);
                        break;
                    case "tool_media_next":
//                        paramAutoThread = EventBus.getDefault();
//                        paramActionBean = new com / lmiot / xyclick / Bean / MediaTypeBean;
//                        paramActionBean.<init> (MediaTypeBean.MediaType.next);
//                        paramAutoThread.post(paramActionBean);
                        break;
                    case "tool_media_pre":
//                        paramActionBean = EventBus.getDefault();
//                        paramAutoThread = new com / lmiot / xyclick / Bean / MediaTypeBean;
//                        paramAutoThread.<init> (MediaTypeBean.MediaType.pre);
//                        paramActionBean.post(paramAutoThread);
                        break;
                    case "tool_media_pause":
//                        paramActionBean = EventBus.getDefault();
//                        paramAutoThread = new com / lmiot / xyclick / Bean / MediaTypeBean;
//                        paramAutoThread.<init> (MediaTypeBean.MediaType.pause);
//                        paramActionBean.post(paramAutoThread);
                        break;
                    case "tool_media_play":
//                        paramAutoThread = EventBus.getDefault();
//                        paramActionBean = new com / lmiot / xyclick / Bean / MediaTypeBean;
//                        paramActionBean.<init> (MediaTypeBean.MediaType.paly);
//                        paramAutoThread.post(paramActionBean);
                        break;
                    case "setting_app_devlop":
                        ActionNormalSDK.getInstance().gotoSettingDeveloper(MyApp.getContext());
                        break;
                    case "setting_app_fly":
                        ActionNormalSDK.getInstance().gotoSetingFLy(MyApp.getContext());
                        break;
                    case "setting_app_as":
                        ActionNormalSDK.getInstance().gotoAssibilityPermissionSetting(MyApp.getContext());
                        break;
                    case "setting_app":
                        ActionNormalSDK.getInstance().gotoSettingAppList(MyApp.getContext());
                        break;
                    case "setting_set_wifi":
                        ActionNormalSDK.getInstance().gotoSetingWifi(MyApp.getContext());
                        break;
                    case "setting_save":
                        ActionNormalSDK.getInstance().gotoSettingMemory(MyApp.getContext());
                        break;
                    case "setting_system":
                        ActionNormalSDK.getInstance().gotoSystemSetting(MyApp.getContext());
                        break;
                    case "setting_set_screen_off":
                        ActionAsSDK.getInstance().performAction(Accessibility.ActionType.GLOBAL_ACTION_LOCK_SCREEN);
                        break;
                    case "key_screen_on":
                        ActionNormalSDK.getInstance().wakeUp(MyApp.getContext());
                        break;
                    case "setting_queit":
                    case "setting_vibrate":
                    case "setting_standard":
//                        paramAutoThread = (NotificationManager) MyApp.getContext().getSystemService("notification");
//                        if ((Build.VERSION.SDK_INT >= 24) && (!paramAutoThread.isNotificationPolicyAccessGranted())) {
//                            paramAutoThread = new android / content / Intent;
//                            paramAutoThread.<init>
//                            ("android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS");
//                            MyApp.getContext().startActivity(paramAutoThread);
//                            ToastUtil.warning("请先找到免ROOT自动化H助手，打开免打扰权限！");
//                            return;
//                        }
//                        i = ((String) localObject4).hashCode();
//                        if (i != -1160082179) {
//                            if (i != -213492788) {
//                                if ((i == 1649007232) && (((String) localObject4).equals("setting_vibrate"))) {
//                                    i = 1;
//                                    break label11509;
//                                }
//                            } else if (((String) localObject4).equals("setting_standard")) {
//                                i = 2;
//                                break label11509;
//                            }
//                        } else if (((String) localObject4).equals("setting_queit")) {
//                            i = 0;
//                            break label11509;
//                        }
//                        i = -1;
//                        if (i != 0) {
//                            if (i != 1) {
//                                if (i == 2) {
//                                    ActionNormalSDK.getInstance().ringAndVibrateModel(MyApp.getContext());
//                                }
//                            } else {
//                                ActionNormalSDK.getInstance().vibrateModel(MyApp.getContext());
//                            }
//                        } else {
//                            ActionNormalSDK.getInstance().noRingAndVibrateModel(MyApp.getContext());
//                        }
                        break;
                    case "setting_set_screen":
                        if (CheckUtil.checkSystemSetting(MyApp.getContext())) {
                            ActionNormalSDK.getInstance();
                            ActionNormalSDK.saveBrightness(MyApp.getContext(), detailBean.getValue());
                        } else {
                            ToastUtil.warning("请先打开系统设置！");
                            ActionNormalSDK.getInstance().gotoSystemPermissionSetting(MyApp.getContext());
                        }
                        break;
                    case "setting_set_volume":
                        ActionNormalSDK.getInstance().controlVolume(MyApp.getContext(), detailBean.getValue());
                        break;
                    case "setting_fly_close":
                        ActionNormalSDK.getInstance().gotoSetingFLy(MyApp.getContext());
                        break;
                    case "setting_fly_open":
                        ActionNormalSDK.getInstance().gotoSetingFLy(MyApp.getContext());
                        break;
                    case "setting_nfc_close":
                        ActionNormalSDK.getInstance().gotoSetingNFC(MyApp.getContext());
                        break;
                    case "setting_nfc_open":
                        ActionNormalSDK.getInstance().gotoSetingNFC(MyApp.getContext());
                        break;
                    case "setting_gps_close":
                        ActionNormalSDK.getInstance().gotoSettingGPS(MyApp.getContext());
                        break;
                    case "setting_gps_open":
                        ActionNormalSDK.getInstance().gotoSettingGPS(MyApp.getContext());
                        break;
                    case "setting_gprs_close":
                        ActionNormalSDK.getInstance().controlFlow(MyApp.getContext(), false);
                        break;
                    case "setting_gprs_open":
                        ActionNormalSDK.getInstance().controlFlow(MyApp.getContext(), true);
                        break;
                    case "setting_notic_close":
                        ActionNormalSDK.getInstance().closeNotification(MyApp.getContext());
                        break;
                    case "setting_notic_open":
                        ActionNormalSDK.getInstance().expandNotification(MyApp.getContext());
                        break;
                    case "setting_led_off":
                        ActionNormalSDK.getInstance().closeLight(MyApp.getContext());
                        break;
                    case "setting_led_on":
                        ActionNormalSDK.getInstance().openLight(MyApp.getContext());
                        break;
                    case "setting_blue_off":
                        ActionNormalSDK.getInstance().controlBlueTooth(MyApp.getContext(), false);
                        break;
                    case "setting_blue_on":
                        ActionNormalSDK.getInstance().controlBlueTooth(MyApp.getContext(), true);
                        break;
                    case "setting_wifi_off":
                        ActionNormalSDK.getInstance().controlWifi(MyApp.getContext(), false);
                        break;
                    case "setting_wifi_on":
                        ActionNormalSDK.getInstance().controlWifi(MyApp.getContext(), true);
                        break;
                    case "key_remote_stop":
                        tip("发送命令：停止动作");
//                        paramActionBean = PushUtils.getInstance();
//                        paramAutoThread = PushTemplate.PushType.NoticAndExtra;
//                        localObject1 = detailBean.getRemoteDevList();
//                        localObject3 = PushUtils.getInstance().getAdminExtraString("push_stop", "");
//                        localObject4 = new com / lmiot / xyclick / Method / DoActionUtils$5;
//                        ((5) localObject4).<init > ();
//                        paramActionBean.pushList(paramAutoThread, (Set) localObject1, "收到指令", "停止自动化", (String) localObject3, (OnBasicListener) localObject4);
                        break;
                    case "key_remote_run":
//                        paramAutoThread = detailBean.getRemoteDevList();
//                        localObject3 = detailBean.getRemoteAutoID();
//                        localObject4 = AutoBeanSqlUtil.getInstance().searchByID((String) localObject3);
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("发送命令：");
//                        paramActionBean.append(((AutoBean) localObject4).getAutoName());
//                        tip(paramActionBean.toString());
//                        localObject1 = PushUtils.getInstance();
//                        paramActionBean = PushTemplate.PushType.NoticAndExtra;
//                        localObject2 = new java / lang / StringBuilder;
//                        ((StringBuilder) localObject2).<init> ();
//                        ((StringBuilder) localObject2).append("自动化名称：");
//                        ((StringBuilder) localObject2).append(((AutoBean) localObject4).getAutoName());
//                        localObject4 = ((StringBuilder) localObject2).toString();
//                        localObject3 = PushUtils.getInstance().getAdminExtraString("push_run", (String) localObject3);
//                        localObject2 = new com / lmiot / xyclick / Method / DoActionUtils$4;
//                        ((4) localObject2).<init > ();
//                        ((PushUtils) localObject1).pushList(paramActionBean, paramAutoThread, "收到分享自动化指令", (String) localObject4, (String) localObject3, (OnBasicListener) localObject2);
                        break;
                    case "key_res_show_notic":
                        ActionAsSDK.getInstance().performAction(Accessibility.ActionType.GLOBAL_ACTION_NOTIFICATIONS);
                        break;
                    case "key_recent":
                        ActionAsSDK.getInstance().performAction(Accessibility.ActionType.GLOBAL_ACTION_RECENTS);
                        break;
                    case "key_long_power":
                        ActionAsSDK.getInstance().performAction(Accessibility.ActionType.GLOBAL_ACTION_POWER_DIALOG);
                        break;
                    case "key_home":
                        ActionAsSDK.getInstance().performAction(Accessibility.ActionType.GLOBAL_ACTION_HOME);
                        break;
                    case "key_back":
                        ActionAsSDK.getInstance().performAction(Accessibility.ActionType.GLOBAL_ACTION_BACK);
                        break;
                    case "key_shortcut_all":
//                        k = OpenCVSDK.getInstance().getPicLike(MyApp.getContext());
//                        paramAutoThread = LoopUtils.cutFull();
//                        paramActionBean = BitmapFactory.decodeFile(detailBean.getImgPath());
//                        localObject1 = new com / lmiot / xyclick / Method / DoActionUtils$3;
//                        ((3) localObject1).<init > ();
//                        paramAutoThread = OpenCVUtils.findAllTarget(paramAutoThread, paramActionBean, k, (OpenCVUtils.OnFindingListener) localObject1);
//                        paramActionBean = new java / lang / StringBuilder;
//                        paramActionBean.<init> ();
//                        paramActionBean.append("imgResultList.size():");
//                        paramActionBean.append(paramAutoThread.size());
//                        LogUtil.d("DoActionUtils", paramActionBean.toString());
//                        if (paramAutoThread.size() > 0) {
//                            paramActionBean = paramAutoThread.iterator();
//                            while (paramActionBean.hasNext()) {
//                                paramAutoThread = (FastResultBean) paramActionBean.next();
//                                EventBus.getDefault().post(paramAutoThread);
//                                if (paramAutoThread.getLikeNum() >= k) {
//                                    j = paramAutoThread.getX();
//                                    m = paramAutoThread.getWidth() / 2;
//                                    int n = paramAutoThread.getY();
//                                    i = paramAutoThread.getHeight() / 2;
//                                    localObject1 = new java / lang / StringBuilder;
//                                    ((StringBuilder) localObject1).<init> ();
//                                    ((StringBuilder) localObject1).append("发现目标图片，相似度：");
//                                    localObject3 = new com / google / gson / Gson;
//                                    ((Gson) localObject3).<init> ();
//                                    ((StringBuilder) localObject1).append(((Gson) localObject3).toJson(paramAutoThread));
//                                    LogUtil.d("DoActionUtils", ((StringBuilder) localObject1).toString());
//                                    localObject1 = new java / lang / StringBuilder;
//                                    ((StringBuilder) localObject1).<init> ();
//                                    ((StringBuilder) localObject1).append("发现目标图片，相似度：");
//                                    ((StringBuilder) localObject1).append(paramAutoThread.getLikeNum());
//                                    tip(((StringBuilder) localObject1).toString());
//                                    ActionAsSDK.getInstance().clickXY(j + m, n + i);
//                                    Thread.sleep(500L);
//                                } else {
//                                    localObject1 = new java / lang / StringBuilder;
//                                    ((StringBuilder) localObject1).<init> ();
//                                    ((StringBuilder) localObject1).append("图片相似度不足：");
//                                    ((StringBuilder) localObject1).append(paramAutoThread.getLikeNum());
//                                    tip(((StringBuilder) localObject1).toString());
//                                }
//                            }
//                        }
                        tip("图片不存在或识别错误！");
                        LogUtil.d("DoActionUtils", "图片不存在或识别错误");
                        break;
                    case "key_shortcut":
                    case "key_shortcut_repeat":
                    case "key_shortcut_repeat_rect":
                    case "click_img_offset":
                    case "long_click_img":
                    case "drap_img":
//                        paramActionBean = LoopUtils.cutFull();
//                        if (((String) localObject4).equals("key_shortcut_repeat_rect")) {
//                            paramActionBean = OpenCVUtils.findOneTarget(BitmapFactory.decodeFile(ImgUtil.saveRectImg(ImgUtil.saveBitmpToCash(paramActionBean, "rect"), detailBean.getRect())), BitmapFactory.decodeFile(detailBean.getImgPath()));
//                        } else {
//                            paramActionBean = OpenCVUtils.findOneTarget(paramActionBean, BitmapFactory.decodeFile(detailBean.getImgPath()));
//                        }
//                        localObject2 = new java / lang / StringBuilder;
//                        ((StringBuilder) localObject2).<init> ();
//                        ((StringBuilder) localObject2).append("找图11:");
//                        localObject1 = new com / youyi / yyviewsdklibrary / ArrayGson;
//                        ((ArrayGson) localObject1).<init> ();
//                        ((StringBuilder) localObject2).append(((ArrayGson) localObject1).toJson(paramActionBean));
//                        LogUtil.d("DoActionUtils", ((StringBuilder) localObject2).toString());
//                        if (paramActionBean != null) {
//                            i = OpenCVSDK.getInstance().getPicLike(MyApp.getContext());
//                            localObject1 = new java / lang / StringBuilder;
//                            ((StringBuilder) localObject1).<init> ();
//                            ((StringBuilder) localObject1).append("picLike:");
//                            ((StringBuilder) localObject1).append(i);
//                            LogUtil.d("DoActionUtils", ((StringBuilder) localObject1).toString());
//                            if (paramActionBean.getLikeNum() >= i) {
//                                EventBus.getDefault().post(paramActionBean);
//                                i = paramActionBean.getX() + paramActionBean.getWidth() / 2;
//                                j = paramActionBean.getY() + paramActionBean.getHeight() / 2;
//                                if (((String) localObject4).equals("key_shortcut")) {
//                                    paramAutoThread = new java / lang / StringBuilder;
//                                    paramAutoThread.<init> ();
//                                    paramAutoThread.append("发现目标图片，相似度：");
//                                    paramAutoThread.append(paramActionBean.getLikeNum());
//                                    tip(paramAutoThread.toString());
//                                    ActionAsSDK.getInstance().clickXY(i, j);
//                                } else if (((String) localObject4).equals("key_shortcut_repeat")) {
//                                    localObject1 = new java / lang / StringBuilder;
//                                    ((StringBuilder) localObject1).<init> ();
//                                    ((StringBuilder) localObject1).append("发现目标图片，相似度：");
//                                    ((StringBuilder) localObject1).append(paramActionBean.getLikeNum());
//                                    tip(((StringBuilder) localObject1).toString());
//                                    clickXYTimes(paramAutoThread, i, j, detailBean.getRepeat(), FloatUtil.getClickTime(MyApp.getContext()));
//                                } else if (((String) localObject4).equals("key_shortcut_repeat_rect")) {
//                                    localObject1 = detailBean.getRect();
//                                    if ((i >= ((Rect) localObject1).left) && (i <= ((Rect) localObject1).right) && (j >= ((Rect) localObject1).top) && (j <= ((Rect) localObject1).bottom)) {
//                                        localObject1 = new java / lang / StringBuilder;
//                                        ((StringBuilder) localObject1).<init> ();
//                                        ((StringBuilder) localObject1).append("发现目标图片，相似度：");
//                                        ((StringBuilder) localObject1).append(paramActionBean.getLikeNum());
//                                        tip(((StringBuilder) localObject1).toString());
//                                        clickXYTimes(paramAutoThread, i, j, detailBean.getRepeat(), FloatUtil.getClickTime(MyApp.getContext()));
//                                    } else {
//                                        tip("图片在区域外！");
//                                    }
//                                } else if (((String) localObject4).equals("click_img_offset")) {
//                                    paramAutoThread = new java / lang / StringBuilder;
//                                    paramAutoThread.<init> ();
//                                    paramAutoThread.append("发现目标图片，相似度：");
//                                    paramAutoThread.append(paramActionBean.getLikeNum());
//                                    tip(paramAutoThread.toString());
//                                    ActionAsSDK.getInstance().clickXY(i + detailBean.getOffsetX(), j + detailBean.getOffsetY());
//                                } else if (((String) localObject4).equals("long_click_img")) {
//                                    paramAutoThread = new java / lang / StringBuilder;
//                                    paramAutoThread.<init> ();
//                                    paramAutoThread.append("发现目标图片，相似度：");
//                                    paramAutoThread.append(paramActionBean.getLikeNum());
//                                    tip(paramAutoThread.toString());
//                                    ActionAsSDK.getInstance().longClickXY(i, j);
//                                } else if (((String) localObject4).equals("drap_img")) {
//                                    paramAutoThread = new java / lang / StringBuilder;
//                                    paramAutoThread.<init> ();
//                                    paramAutoThread.append("发现目标图片，相似度：");
//                                    paramAutoThread.append(paramActionBean.getLikeNum());
//                                    tip(paramAutoThread.toString());
//                                    paramAutoThread = ActionAsSDK.getInstance();
//                                    paramActionBean = new com / xiaoyi / intentsdklibrary / Bean / PointBean;
//                                    paramActionBean.<init> (i, j);
//                                    paramAutoThread.drapTo(paramActionBean, detailBean.getPointBean(), FloatUtil.getSlip(MyApp.getContext()));
//                                }
//                            } else {
//                                paramAutoThread = new java / lang / StringBuilder;
//                                paramAutoThread.<init> ();
//                                paramAutoThread.append("图片相似度不足：");
//                                paramAutoThread.append(paramActionBean.getLikeNum());
//                                tip(paramAutoThread.toString());
//                            }
//                        } else {
//                            tip("图片不存在或识别错误！");
//                            LogUtil.d("DoActionUtils", "图片不存在或识别错误");
//                        }
                        break;
                    case "key_img_delay":
//                        paramAutoThread = OpenCVUtils.findOneTarget(LoopUtils.cutFull(), BitmapFactory.decodeFile(detailBean.getImgPath()));
//                        i = detailBean.getRepeat();
//                        if (paramAutoThread != null) {
//                            if (paramAutoThread.getLikeNum() >= i) {
//                                i = paramAutoThread.getX();
//                                k = paramAutoThread.getWidth() / 2;
//                                j = paramAutoThread.getY();
//                                m = paramAutoThread.getHeight() / 2;
//                                EventBus.getDefault().post(paramAutoThread);
//                                paramActionBean = new java / lang / StringBuilder;
//                                paramActionBean.<init> ();
//                                paramActionBean.append("发现目标图片，相似度：");
//                                paramActionBean.append(paramAutoThread.getLikeNum());
//                                tip(paramActionBean.toString());
//                                Thread.sleep(detailBean.getDruation());
//                                ActionAsSDK.getInstance().clickXY(i + k, j + m);
//                            } else {
//                                paramActionBean = new java / lang / StringBuilder;
//                                paramActionBean.<init> ();
//                                paramActionBean.append("图片相似度不足：");
//                                paramActionBean.append(paramAutoThread.getLikeNum());
//                                tip(paramActionBean.toString());
//                            }
//                        } else {
//                            tip("图片不存在或识别错误！");
//                            LogUtil.d("DoActionUtils", "图片不存在或识别错误");
//                        }
                        break;
                    case "key_img_pick":
                        Bitmap bitmap = LoopUtils.cutFull();
                        FastResultBean fastResultBean = OpenCVUtils.findOneTarget(bitmap, BitmapFactory.decodeFile(detailBean.getImgPath()));
                        LkxLog.d("找图cutFull完成:"+fastResultBean.getLikeNum());
                        i = detailBean.getRepeat();
                        if (fastResultBean != null) {
                            if (fastResultBean.getLikeNum() >= i) {
                                j = fastResultBean.getX();
                                int k = fastResultBean.getWidth() / 2;
                                int m = fastResultBean.getY();
                                int n = fastResultBean.getHeight() / 2;
                                EventBus.getDefault().post(fastResultBean);
                                tip("发现目标图片，相似度："+fastResultBean.getLikeNum());
                                LkxLog.d("匹配图片:"+j+k+","+m+n);
                                ActionAsSDK.getInstance().clickXY(j + k, m + n);
                            } else {
                                tip("图片相似度不足："+fastResultBean.getLikeNum());
                            }
                        } else {
                            tip("图片不存在或识别错误！");
                            LogUtil.d("DoActionUtils", "图片不存在或识别错误");
                        }
                        break;
                    case "past_text":
//                        paramAutoThread = SearchSDK.getInstance().getPastText(MyApp.getContext());
//                        ActionAsSDK.getInstance().inputTextByXY(detailBean.getPointBean().getX(), detailBean.getPointBean().getY(), paramAutoThread);
                        break;
                    case "random_input_text_max_nin":
//                        m = detailBean.getMaxNum();
//                        j = detailBean.getMinNum();
//                        paramAutoThread = new java / util / Random;
//                        paramAutoThread.<init> ();
//                        i = paramAutoThread.nextInt(m);
//                        paramActionBean = new java / util / ArrayList;
//                        paramActionBean.<init> ();
//                        paramAutoThread = new java / lang / StringBuilder;
//                        paramAutoThread.<init> ();
//                        paramAutoThread.append(i % (m - j + 1) + j);
//                        paramAutoThread.append("");
//                        paramActionBean.add(paramAutoThread.toString());
//                        ActionAsSDK.getInstance().inputTextByForm(paramActionBean);
                        break;
                    case "list_input_text_library":
                        List<String> stringList = detailBean.getStringList();
                        j = stringList.size();
                        i = MyApp.mFinishNumRun;
                        if (AutoBeanSqlUtil.getInstance().searchByID(paramActionBean.getAutoID()).getAutoID().equals(MyApp.mAutoBeanNowRun.getAutoID())) {
                            i = MyApp.mFinishNumRun;
                        } else {
                            i = insignAutoNum;
                        }
                        if (i <= 0) {
                            i = 0;
                        }

                        String str = "";
                        if (i < j) {
                            str = stringList.get(i);
                        } else {
                            str = stringList.get(j - 1);
                        }
                        List<String>  strings = new ArrayList<>();
                        strings.add(str);
                        ActionAsSDK.getInstance().inputTextByForm(strings);
                        break;
                    case "list_input_text_library_three":
//                        try {
//                            paramAutoThread = detailBean.getThreeBeanList();
//                            j = paramAutoThread.size();
//                            if (AutoBeanSqlUtil.getInstance().searchByID(paramActionBean.getAutoID()).getAutoID().equals(MyApp.mAutoBeanNowRun.getAutoID())) {
//                                i = MyApp.mFinishNumRun;
//                            } else {
//                                i = insignAutoNum;
//                            }
//                            if (i <= 0) {
//                                i = 0;
//                            }
//                            if (i < j) {
//                                paramAutoThread = (TextThreeBean) paramAutoThread.get(i);
//                            } else {
//                                paramAutoThread = (TextThreeBean) paramAutoThread.get(j - 1);
//                            }
//                            paramActionBean = new java / util / ArrayList;
//                            paramActionBean.<init> ();
//                            paramActionBean.add(paramAutoThread.getUserName());
//                            paramActionBean.add(paramAutoThread.getPhone());
//                            paramActionBean.add(paramAutoThread.getIDCard());
//                            ActionAsSDK.getInstance().inputTextByForm(paramActionBean);
//                        } catch (Exception paramAutoThread) {
//                            paramAutoThread.printStackTrace();
//                        }
                    case "list_input_text_library_username":
//                        try {
//                            paramAutoThread = detailBean.getTextUserList();
//                            j = paramAutoThread.size();
//                            if (AutoBeanSqlUtil.getInstance().searchByID(paramActionBean.getAutoID()).getAutoID().equals(MyApp.mAutoBeanNowRun.getAutoID())) {
//                                i = MyApp.mFinishNumRun;
//                            } else {
//                                i = insignAutoNum;
//                            }
//                            if (i <= 0) {
//                                i = 0;
//                            }
//                            if (i < j) {
//                                paramAutoThread = (TextUserName) paramAutoThread.get(i);
//                            } else {
//                                paramAutoThread = (TextUserName) paramAutoThread.get(j - 1);
//                            }
//                            paramActionBean = new java / util / ArrayList;
//                            paramActionBean.<init> ();
//                            paramActionBean.add(paramAutoThread.getUserName());
//                            paramActionBean.add(paramAutoThread.getPassword());
//                            ActionAsSDK.getInstance().inputTextByForm(paramActionBean);
//                        } catch (Exception paramAutoThread) {
//                            paramAutoThread.printStackTrace();
//                        }
                    case "random_input_text_library":
//                        paramAutoThread = detailBean.getStringList();
//                        i = paramAutoThread.size();
//                        paramActionBean = new java / util / Random;
//                        paramActionBean.<init> ();
//                        j = paramActionBean.nextInt(i);
//                        paramActionBean = new java / util / ArrayList;
//                        paramActionBean.<init> ();
//                        paramActionBean.add((String) paramAutoThread.get(j % (i - 0 + 1) + 0));
//                        ActionAsSDK.getInstance().inputTextByForm(paramActionBean);
                        break;
                    case "key_input_list":
                        ActionAsSDK.getInstance().inputTextByForm(detailBean.getStringList());
                        break;
                    case "key_input_by_rect":
                        ActionAsSDK.getInstance().inputTextByRect(detailBean.getRect(), detailBean.getText());
                        break;
                    case "key_input_by_position":
                        ActionAsSDK.getInstance().inputTextByPosition(detailBean.getSortNum(), detailBean.getText());
                        break;
                    case "key_input_by_http":
//                        paramAutoThread = detailBean.getHttpType();
//                        paramActionBean = detailBean.getHttpUrl();
//                        if (paramAutoThread.equals("get")) {
//                            paramActionBean = ((GetBuilder) OkHttpUtils.get().url(paramActionBean)).build();
//                            paramAutoThread = new com / lmiot / xyclick / Method / DoActionUtils$1;
//                            paramAutoThread.<init> ();
//                            paramActionBean.execute(paramAutoThread);
//                        } else {
//                            paramActionBean = ((PostFormBuilder) OkHttpUtils.post().url(paramActionBean)).build();
//                            paramAutoThread = new com / lmiot / xyclick / Method / DoActionUtils$2;
//                            paramAutoThread.<init> ();
//                            paramActionBean.execute(paramAutoThread);
//                        }
                        break;
                    case "key_input":
                        ActionAsSDK.getInstance().inputTextByXY(detailBean.getPointBean().getX(), detailBean.getPointBean().getY(), detailBean.getText());
                        break;
                    case "copy_screen_text":
                    case "copy_rect_text":
//                        if (((String) localObject4).equals("copy_screen_text")) {
//                        }
//                        for (paramAutoThread = LoopUtils.cutFull(); ; paramAutoThread = LoopUtils.cutRect(detailBean.getRect())) {
//                            break;
//                        }
//                        paramActionBean = LoopUtils.OCRTextByTargetText(paramAutoThread, null);
//                        try {
//                            paramAutoThread = new java / lang / StringBuffer;
//                            paramAutoThread.<init> ();
//                            paramActionBean = paramActionBean.iterator();
//                            while (paramActionBean.hasNext()) {
//                                paramAutoThread.append(((OCRResultBean) paramActionBean.next()).getWord());
//                                paramAutoThread.append("\n");
//                            }
//                            paramActionBean = EventBus.getDefault();
//                            localObject1 = new com / lmiot / xyclick / Bean / CopyTextBean;
//                            ((CopyTextBean) localObject1).<init>
//                            (paramAutoThread.toString().trim());
//                            paramActionBean.post(localObject1);
//                        } catch (Exception paramAutoThread) {
//                            paramAutoThread.printStackTrace();
//                        }
                    case "key_click_text_ocr":
                    case "click_text_offset":
                    case "key_click_text_ocr_rect":
                    case "click_text_offset_rect":
//                        new ArrayList();
//                        paramActionBean = LoopUtils.OCRTextByTargetText(LoopUtils.cutFull(), detailBean.getText());
//                        if (paramActionBean.size() == 0) {
//                            tip("没发现目标文字");
//                        } else {
//                            localObject1 = (OCRResultBean) paramActionBean.get(0);
//                            tip("发现目标文字");
//                            j = ((OCRResultBean) localObject1).getCenterX();
//                            i = ((OCRResultBean) localObject1).getCenterY();
//                            if (((String) localObject4).equals("key_click_text_ocr")) {
//                                ActionAsSDK.getInstance().clickXY(j, i);
//                            } else if (((String) localObject4).equals("click_text_offset")) {
//                                ActionAsSDK.getInstance().clickXY(j + detailBean.getOffsetX(), i + detailBean.getOffsetY());
//                            } else if (((String) localObject4).equals("key_long_click_text")) {
//                                ActionAsSDK.getInstance().longClickXY(j + detailBean.getOffsetX(), i + detailBean.getOffsetY());
//                            } else if ((((String) localObject4).equals("key_click_text_ocr_rect")) || (((String) localObject4).equals("click_text_offset_rect")) || (((String) localObject4).equals("key_long_click_text_rect"))) {
//                                localObject2 = paramActionBean.iterator();
//                                while (((Iterator) localObject2).hasNext()) {
//                                    paramActionBean = (OCRResultBean) ((Iterator) localObject2).next();
//                                    if (paramAutoThread.pause) {
//                                        paramAutoThread.onPause();
//                                    }
//                                    if (SDK.isRunning) {
//                                        j = paramActionBean.getCenterX();
//                                        i = paramActionBean.getCenterY();
//                                        localObject1 = detailBean.getRect();
//                                        if ((j >= ((Rect) localObject1).left) && (j <= ((Rect) localObject1).right) && (i >= ((Rect) localObject1).top) && (i <= ((Rect) localObject1).bottom)) {
//                                            paramAutoThread = paramActionBean;
//                                            break label14664;
//                                        }
//                                    }
//                                }
//                                paramAutoThread = null;
//                                if (paramAutoThread == null) {
//                                    tip("文字在区域外");
//                                } else {
//                                    j = paramAutoThread.getCenterX();
//                                    i = paramAutoThread.getCenterY();
//                                    tip("发现目标文字");
//                                    if (((String) localObject4).equals("key_click_text_ocr_rect")) {
//                                        ActionAsSDK.getInstance().clickXY(j, i);
//                                    } else if (((String) localObject4).equals("key_long_click_text_rect")) {
//                                        ActionAsSDK.getInstance().longClickXY(j + detailBean.getOffsetX(), i + detailBean.getOffsetY());
//                                    } else {
//                                        ActionAsSDK.getInstance().clickXY(j + detailBean.getOffsetX(), i + detailBean.getOffsetY());
//                                    }
//                                }
//                            }
//                        }
                        break;
                    case "key_click_text_rect":
                        clickTextRectTimes(paramAutoThread, detailBean.getText(), detailBean.getRect(), 1);
                        break;
                    case "key_long_click_text":
                        ActionAsSDK.getInstance().longClickText(detailBean.getText());
                        break;
                    case "key_click_text_all":
                        List<TextBean> textBeanList = ActionAsSDK.getInstance().findAllText();
                        if (textBeanList != null) {
                            if (textBeanList.size() > 0) {
                                tip("遍历点击目标文字！");
                                Iterator<TextBean> beanIterator = textBeanList.iterator();
                                while (beanIterator.hasNext()) {
                                    TextBean textBean = beanIterator.next();
                                    if (paramAutoThread.pause) {
                                        paramAutoThread.onPause();
                                    }
                                    if (!SDK.isRunning) {
                                        break;
                                    }
                                    String text = textBean.getText();
                                    if ((!TextUtils.isEmpty(text)) && (text.equals(detailBean.getText())) || (text.contains(detailBean.getText()))) {
                                        ActionAsSDK.getInstance().clickXY(textBean.getClickX(), textBean.getClickY());
                                        Thread.sleep(1000L);
                                    }
                                }
                            }
                        } else {
                            tip("找不到目标文字！");
                        }
                        break;
                    case "key_click_t_rnum":
                        ActionAsSDK.getInstance().clickTextNum(detailBean.getText(), detailBean.getValue());
                        break;
                    case "key_click_t_last":
                        ActionAsSDK.getInstance().clickTextLastNum(detailBean.getText());
                        break;
                    case "key_click_text":
                        ActionAsSDK.getInstance().clickText(detailBean.getText());
                        break;
                    case "key_click_t_wait":
                        j = detailBean.getDruation();
                        for (i = 0; i < j; i++) {
                            if (paramAutoThread.pause) {
                                paramAutoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            if (ActionAsSDK.getInstance().findAllText01().contains(detailBean.getText())) {
                                tip("发现目标文字");
                                ActionAsSDK.getInstance().clickText(detailBean.getText());
                                break;
                            }
                            Thread.sleep(1000L);
                            if (i == j - 1) {
                                tip("等待超时");
                            }
                        }
                    case "key_swipe_smaller":
                        ActionAsSDK.getInstance().swipeSmaller(FloatUtil.getSlip(MyApp.getContext()));
                        break;
                    case "key_swipe_bigger":
                        ActionAsSDK.getInstance().swipeBigger(FloatUtil.getSlip(MyApp.getContext()));
                        break;
                    case "key_path_list":
                        ActionAsSDK.getInstance().pathList(FloatUtil.getSlip(MyApp.getContext()),mPointBeanList);
                        break;
                    case "key_drap_to":
                        ActionAsSDK.getInstance().drapTo((PointBean) mPointBeanList.get(0), mPointBeanList.get(1), FloatUtil.getSlip(MyApp.getContext()));
                        break;
                    case "key_swip_to"://从A点滑到B
                    case "key_swip_plus":
                        ActionAsSDK.getInstance().pathList(FloatUtil.getSlip(MyApp.getContext()), mPointBeanList);
                        break;
                    case "key_swip_down":
                        ActionAsSDK.getInstance().swipeDown(FloatUtil.getSlip(MyApp.getContext()));
                        break;
                    case "key_swip_up":
                        ActionAsSDK.getInstance().swipeUp(FloatUtil.getSlip(MyApp.getContext()));
                        break;
                    case "key_swip_right":
                        ActionAsSDK.getInstance().swipeRight(FloatUtil.getSlip(MyApp.getContext()));
                        break;
                    case "key_swip_left":
                        ActionAsSDK.getInstance().swipeLeft(FloatUtil.getSlip(MyApp.getContext()));
                        break;
                    case "key_long_click_points":
                        ActionAsSDK.getInstance().longClickMultiPoint(detailBean.getDruation() * 1000, detailBean.getPointBeanList());
                        break;
                    case "key_click_points":
                        clickMultiPointTimes(paramAutoThread, detailBean.getPointBeanList(), detailBean.getRepeat());
                        break;
                    case "key_long_click_user_ms":
                        ActionAsSDK.getInstance().longClickXYTimes(detailBean.getPointBean().getX(), detailBean.getPointBean().getY(), detailBean.getDruation());
                        break;
                    case "key_long_click_user":
                        ActionAsSDK.getInstance().longClickXYTimes(detailBean.getPointBean().getX(), detailBean.getPointBean().getY(), detailBean.getDruation() * 1000);
                        break;
                    case "key_long_click":
                        ActionAsSDK.getInstance().longClickXY(detailBean.getPointBean().getX(), detailBean.getPointBean().getY());
                        break;
                    case "key_rect_click":
                        clickRectRandom(paramAutoThread, detailBean.getRect(), detailBean.getRepeat(), FloatUtil.getClickTime(MyApp.getContext()));
                        break;
                    case "key_double_location":
                        ActionAsSDK.getInstance().doubleClickXY(detailBean.getPointBean().getX(), detailBean.getPointBean().getY());
                        break;
                    case "key_location_time_by_hand":
                        clickXYTimes(paramAutoThread, detailBean.getPointBean().getX(), detailBean.getPointBean().getY(), detailBean.getRepeat(), DataUtil.getHandClickTime(MyApp.getContext()));
                        break;
                    case "key_location_time":
                        clickXYTimes(paramAutoThread, detailBean.getPointBean().getX(), detailBean.getPointBean().getY(), detailBean.getRepeat(), FloatUtil.getClickTime(MyApp.getContext()));
                        break;
                    case "key_location":
                        ActionAsSDK.getInstance().clickXY(detailBean.getPointBean().getX(), detailBean.getPointBean().getY());
                        break;
                    case "new_clic_percent":
                        i = MyApp.mWidth * detailBean.getClickX() / 100;
                        j = MyApp.mHeight * detailBean.getClickY() / 100;
                        ActionAsSDK.getInstance().clickXY(i, j);
                        break;
                    case "new_click_xy":
                        label14664:
                        ActionAsSDK.getInstance().clickXY(detailBean.getClickX(), detailBean.getClickY());
                        break;
                }
            } else {
                StringBuilder sb = new StringBuilder();
                sb.append("跳过：");
                sb.append(paramActionBean.getActionName());
                tip(sb.toString());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static void executeAuto(AutoThread autoThread, AutoBean autoBean, int i) {
        try {
            LogUtil.d(TAG, "开始执行自动化:" + autoBean.getAutoName());
            List<ActionBean> searchByID = ActionBeanSqlUtil.getInstance().searchByID(autoBean.getAutoID());
            sortList(searchByID);
            for (int i2 = 0; i2 < searchByID.size(); i2++) {
                if (autoThread.pause) {
                    autoThread.onPause();
                }
                if (!SDK.isRunning) {
                    return;
                }
                ActionBean actionBean = searchByID.get(i2);
                String actionType = actionBean.getActionType();
                if (actionType.equals(Constants.ACTION_TYPE_IF_GOTO)) {
                    i = ((DetailBean) new Gson().fromJson(actionBean.getDetail(), DetailBean.class)).getGotoNum();
                }
                if (actionType.equals(Constants.ACTION_TYPE_IF_PLUS_GOTO)) {
                    ActionBean gotoAction = ((DetailBean) new Gson().fromJson(actionBean.getDetail(), DetailBean.class)).getGotoAction();
                    List<ActionBean> searchByID2 = ActionBeanSqlUtil.getInstance().searchByID(gotoAction.getAutoID());
                    int i3 = -1;
                    if (searchByID2 != null && searchByID2.size() > 0) {
                        int i4 = 0;
                        while (true) {
                            if (i4 >= searchByID2.size()) {
                                break;
                            }
                            if (autoThread.pause) {
                                autoThread.onPause();
                            }
                            if (!SDK.isRunning) {
                                break;
                            }
                            if (searchByID2.get(i4).getActionID().equals(gotoAction.getActionID())) {
                                i3 = i4;
                                break;
                            }
                            i4++;
                        }
                    }
                    i = i3;
                }
                int delay = actionBean.getDelay();
                if (i2 >= i) {
                    doAction(autoThread, actionBean);
                    if (actionBean.getEnable()) {
                        if (FloatUtil.getAutoMs(MyApp.getContext())) {
                            Thread.sleep(delay);
                        } else {
                            Thread.sleep(delay * 1000);
                        }
                    } else {
                        Thread.sleep(10L);
                    }
                } else {
                    Thread.sleep(500L);
                }
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    private static int getRectNum(Rect paramRect) {
        Object localObject = ActionAsSDK.getInstance().findAllText();
        StringBuffer localStringBuffer = new StringBuffer();
        localObject = ((List) localObject).iterator();
        while (((Iterator) localObject).hasNext()) {
            TextBean localTextBean = (TextBean) ((Iterator) localObject).next();
            Rect localRect = new Rect(localTextBean.getLeft(), localTextBean.getTop(), localTextBean.getRight(), localTextBean.getBottom());
            if ((paramRect.contains(localRect)) || (paramRect.intersect(localRect))) {
                localStringBuffer.append(localTextBean.getText());
            }
        }
        return MathUtils.parseInt(MathUtils.findIntNum(localStringBuffer.toString().trim()));
    }

    private static void jumgGoto(AutoThread autoThread, AutoBean autoBean, int i) {
        if (autoBean.getAutoID().equals(MyApp.mAutoBeanNowRun.getAutoID())) {
            tip("跳转到第：" + i + "个动作执行");
            EventBus.getDefault().post(new DoAutoBean(106, autoBean, null, i));
            return;
        }
        tip("跳转到第：" + i + "个动作执行(嵌套)");
        int repeatNum = autoBean.getRepeatNum();
        if (repeatNum > 0) {
            for (int i2 = 0; i2 < repeatNum; i2++) {
                if (autoThread.pause) {
                    autoThread.onPause();
                }
                if (!SDK.isRunning) {
                    return;
                }
                executeAuto(autoThread, autoBean, i);
            }
            return;
        }
        if (repeatNum == 0) {
            executeAuto(autoThread, autoBean, i);
        } else if (repeatNum == -1) {
            while (SDK.isRunning) {
                if (autoThread.pause) {
                    autoThread.onPause();
                }
                executeAuto(autoThread, autoBean, i);
            }
        }
    }

    public static void recyListView(int i, AutoThread autoThread, ViewBean viewBean, ViewBean viewBean2) {
        char c;
        int i2;
        char c2;
        if (autoThread.pause) {
            autoThread.onPause();
        }
        try {
            AccessibilityNodeInfo findNodeByLimit = Accessibility.getInstance().findNodeByLimit(viewBean);
            if (findNodeByLimit == null) {
                EventBus.getDefault().post(new TopTipBean("找不到目标控件"));
                return;
            }
            int childCount = findNodeByLimit.getChildCount();
            int i3 = 0;
            while (i3 < childCount && (i == -1 || mLimitString.size() < i)) {
                if (autoThread.pause) {
                    autoThread.onPause();
                }
                if (SDK.isRunning) {
                    AccessibilityNodeInfo child = findNodeByLimit.getChild(i3);
                    String findLimitText = Accessibility.getInstance().findLimitText(child, viewBean2);
                    if (!TextUtils.isEmpty(findLimitText) && !mLimitString.contains(findLimitText)) {
                        mLimitString.add(findLimitText);
                        for (ActionBean actionBean : listViewActionBeanList) {
                            String actionType = actionBean.getActionType();
                            switch (actionType.hashCode()) {
                                case -693282604:
                                    if (actionType.equals(Constants.ACTION_TYPE_VIEW_CHECK_INSIGN_LISTVIEW)) {
                                        c = 3;
                                        break;
                                    }
                                    c = 65535;
                                    break;
                                case -639868463:
                                    if (actionType.equals(Constants.ACTION_TYPE_VIEW_INPUT_INSIGN_LISTVIEW)) {
                                        c = 2;
                                        break;
                                    }
                                    c = 65535;
                                    break;
                                case 9552984:
                                    if (actionType.equals(Constants.ACTION_TYPE_VIEW_CLICK_INSIGN_LISTVIEW)) {
                                        c = 0;
                                        break;
                                    }
                                    c = 65535;
                                    break;
                                case 157282498:
                                    if (actionType.equals(Constants.ACTION_TYPE_VIEW_LONG_CLICK_INSIGN_LISTVIEW)) {
                                        c = 1;
                                        break;
                                    }
                                    c = 65535;
                                    break;
                                case 491951468:
                                    if (actionType.equals(Constants.ACTION_TYPE_VIEW_UNCHECK_INSIGN_LISTVIEW)) {
                                        c = 4;
                                        break;
                                    }
                                    c = 65535;
                                    break;
                                default:
                                    c = 65535;
                                    break;
                            }
                            if (c == 0 || c == 1 || c == 2 || c == 3 || c == 4) {
                                DetailBean detailBean = (DetailBean) new Gson().fromJson(actionBean.getDetail(), DetailBean.class);
                                if (detailBean != null) {
                                    AccessibilityNodeInfo findLimitListViewNode = Accessibility.getInstance().findLimitListViewNode(child, detailBean.getViewBean());
                                    if (findLimitListViewNode != null) {
                                        tip("正在：" + actionBean.getActionName());
                                        Rect rect = new Rect();
                                        findLimitListViewNode.getBoundsInScreen(rect);
                                        int i4 = rect.left;
                                        i2 = childCount;
                                        int i5 = rect.top;
                                        int width = i4 + (rect.width() / 2);
                                        int height = i5 + (rect.height() / 2);
                                        String actionType2 = actionBean.getActionType();
                                        switch (actionType2.hashCode()) {
                                            case -693282604:
                                                if (actionType2.equals(Constants.ACTION_TYPE_VIEW_CHECK_INSIGN_LISTVIEW)) {
                                                    c2 = 2;
                                                    break;
                                                }
                                                c2 = 65535;
                                                break;
                                            case 9552984:
                                                if (actionType2.equals(Constants.ACTION_TYPE_VIEW_CLICK_INSIGN_LISTVIEW)) {
                                                    c2 = 0;
                                                    break;
                                                }
                                                c2 = 65535;
                                                break;
                                            case 157282498:
                                                if (actionType2.equals(Constants.ACTION_TYPE_VIEW_LONG_CLICK_INSIGN_LISTVIEW)) {
                                                    c2 = 1;
                                                    break;
                                                }
                                                c2 = 65535;
                                                break;
                                            case 491951468:
                                                if (actionType2.equals(Constants.ACTION_TYPE_VIEW_UNCHECK_INSIGN_LISTVIEW)) {
                                                    c2 = 3;
                                                    break;
                                                }
                                                c2 = 65535;
                                                break;
                                            default:
                                                c2 = 65535;
                                                break;
                                        }
                                        if (c2 == 0) {
                                            ActionAsSDK.getInstance().clickXY(width, height);
                                        } else if (c2 == 1) {
                                            ActionAsSDK.getInstance().longClickXY(width, height);
                                        } else if (c2 == 2) {
                                            if (!findLimitListViewNode.isChecked()) {
                                                ActionAsSDK.getInstance().clickXY(width, height);
                                            }
                                        } else if (c2 == 3 && findLimitListViewNode.isChecked()) {
                                            ActionAsSDK.getInstance().clickXY(width, height);
                                        }
                                    } else {
                                        i2 = childCount;
                                        tip("找到到目标,无法" + actionBean.getActionName());
                                    }
                                    Thread.sleep(1000L);
                                    childCount = i2;
                                }
                            } else {
                                doAction(autoThread, actionBean);
                            }
                            i2 = childCount;
                            Thread.sleep(1000L);
                            childCount = i2;
                        }
                    }
                    i3++;
                    childCount = childCount;
                }
            }
            if (SDK.isRunning) {
                if (autoThread.pause) {
                    autoThread.onPause();
                }
                Rect rect2 = new Rect();
                findNodeByLimit.getBoundsInScreen(rect2);
                int i6 = rect2.left;
                int i7 = rect2.top;
                int i8 = rect2.bottom;
                int width2 = rect2.width();
                int height2 = rect2.height();
                int i9 = i6 + (width2 / 2);
                int i10 = height2 / 2;
                int i11 = height2 / 4;
                Accessibility.getInstance().swipe(i9, i8 - i11, i9, i7 + i11, 200);
                Thread.sleep(1000L);
                if (i != -1) {
                    if (mLimitString.size() < i) {
                        recyListView(i, autoThread, viewBean, viewBean2);
                        return;
                    }
                    return;
                }
                recyListView(i, autoThread, viewBean, viewBean2);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static void sortList(List<ActionBean> list) {
        Collections.sort(list, new Comparator<ActionBean>() {

            @Override // java.util.Comparator
            public int compare(ActionBean actionBean, ActionBean actionBean2) {
                if (actionBean.getSortNum() > actionBean2.getSortNum()) {
                    return 1;
                }
                return actionBean.getSortNum() == actionBean2.getSortNum() ? 0 : -1;
            }
        });
    }

    public static void tip(String paramString) {
        EventBus.getDefault().post(new TopTipBean(paramString));
    }
}
